﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="lc_ModifyLegalAffairs.aspx.cs" Inherits="HFWebApp.lawyeruser.lc_ModifyLegalAffairs" %>
<%@ Register src="../Control/top.ascx" tagname="top" tagprefix="uc1" %>
<%@ Register src="../Control/end.ascx" tagname="end" tagprefix="uc2" %>
<%@ Register src="c_LeftMenu.ascx" tagname="c_LeftMenu" tagprefix="uc3" %>
<%@ Register src="../Control/c_LawyerRegAffairsClass.ascx" tagname="c_LawyerRegAffairsClass" tagprefix="uc3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<title>用户管理中心_红法网</title>
<link href="<%=this.getDemain %>/Style/Style.css" rel="stylesheet" type="text/css" />
<link href="<%=this.getDemain %>/Style/CenterStyle.css" rel="stylesheet" type="text/css" />
<link href="<%=this.getDemain %>/CSS.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=this.getDemain %>/Scripts/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=this.getDemain %>/javascript/SwitchTags.js"></script>
<script type="text/javascript" src="<%=this.getDemain %>/Scripts/WebFunction.js"></script>
<script type="text/javascript">
    var areas_str = '<%=lawyerAreas %>';

    function bindCheckBox(areas_str) {
        var AreasArray = areas_str.split(',');
        var f = document.getElementById('Form1');
        var nodelist = f["Areas"];  // cid[]为checkbox的name属性
        for (var j = 0; j < nodelist.length; j++) {
            for (var i = 0; i < AreasArray.length; i++) {
                if (nodelist[j].value == AreasArray[i]) {
                    nodelist[j].checked = true;
                }
            }
        }
    }

    function ModifyAreas() {
        var limitCount = 10;
        var selectCount = 0;
        var f = document.getElementById('Form1');
        var cids = [];
        var nodelist = f["Areas"];  // cid[]为checkbox的name属性
        var AreasList = "";
        for (var i = 0; i < nodelist.length; i++) {
            if (nodelist[i].checked) {
                selectCount++;
            }
        }
        if (selectCount > limitCount) {
            alert("您只能选择10个专长领域");
            return false;
        }
        if (selectCount == 0) {
            alert("您必须选择至少1个专长领域");
            return false;
        }

        for (var i = 0; i < nodelist.length; i++) {
            if (nodelist[i].checked) {
                if (AreasList == "") {
                    AreasList = nodelist[i].value;
                } else {
                    AreasList = AreasList + "|" + nodelist[i].value;
                }
            }
        }

        $.getJSON(
            "/AjaxSource/LawyerModify.ashx",
            {
                action: "3",
                areas: AreasList,
                rand: Math.floor(Math.random() * 10000).toString()
            },
            function (jsonData) {
                alert(jsonData.Message);
            }
        );

        return false;
    }

    $(function () {
        loadProvince('ask_provinceid', 'ask_cityid');
        bindCheckBox(areas_str);
    });
</script>
</head>

<body>
<uc1:top ID="top1" MenuClassID="1" focusLink1="focusLink" runat="server" />
<div id="c_BodyBox">
    <div class="c_LeftMenu">
        <uc3:c_LeftMenu ID="c_LeftMenu1" runat="server" />
    </div>
    <div class="c_RightContent">
        <h3>修改擅长领域</h3>
            <div class="c_MessageBox">
            <ul>
            <form id="Form1" onsubmit="return ModifyAreas();">
                <li><strong>民事类</strong></li>
                <li>
                    <div class="c_MB_Mid_Fix2"><uc3:c_LawyerRegAffairsClass ID="c_LawyerRegAffairsClass1" LegalAffairID="1"  runat="server" /></div>
                </li>
                <li><strong>经济类</strong></li>
                <li>
                    <div class="c_MB_Mid_Fix2"><uc3:c_LawyerRegAffairsClass ID="c_LawyerRegAffairsClass2" LegalAffairID="2"  runat="server" /></div>
                </li>
                <li><strong>刑事行政</strong></li>
                <li>
                    <div class="c_MB_Mid_Fix2"><uc3:c_LawyerRegAffairsClass ID="c_LawyerRegAffairsClass3" LegalAffairID="3"  runat="server" /></div>
                </li>
                <li><strong>涉外法律</strong></li>
                <li>
                    <div class="c_MB_Mid_Fix2"><uc3:c_LawyerRegAffairsClass ID="c_LawyerRegAffairsClass4" LegalAffairID="4"  runat="server" /></div>
                </li>
                <li><strong>公司专项</strong></li>
                <li>
                    <div class="c_MB_Mid_Fix2"><uc3:c_LawyerRegAffairsClass ID="c_LawyerRegAffairsClass5" LegalAffairID="5"  runat="server" /></div>
                </li>
                <li><strong>其他事务</strong></li>
                <li>
                    <div class="c_MB_Mid_Fix2"><uc3:c_LawyerRegAffairsClass ID="c_LawyerRegAffairsClass6" LegalAffairID="6"  runat="server" /></div>
                </li>
                <li>
                    <div class="c_MB_Mid_Fix">&nbsp;</div>
                </li>
                <li>
                    <div class="c_MB_Mid_Fix">
                        <input id="Button1" type="submit" value="修改" /></div>
                </li>
            </form>
            </ul>
        </div>
    </div>
    </div>
<uc2:end ID="end1" runat="server" />
</body>
</html>
